<?php
namespace App\Support\Sms;

use App\Contracts\Sms\SmsCacheContracts;

class SmsCacheSupport implements SmsCacheContracts
{
    protected $exp;

    public function VerificationCache($key, $code, $phone)
    {
        \Cache::put($key, [
            'phone' => $phone,
            'code'  => $code
        ],$this->exp);
    }

    public function setExp($exp)
    {
        $this->exp = now()->addMinutes($exp);
    }

    public function getExp()
    {
        return $this->exp;
    }

    public function getVerificationCodes($key)
    {
        return \Cache::get($key);
    }

    public function delVerificationCodes($key)
    {
        \Cache::forget($key);
    }

}